//
//  UILable+Extension.swift
//  个人微博
//
//  Created by guo3920591 on 16/4/16.
//  Copyright © 2016年 guo3920591. All rights reserved.
//

import UIKit

extension UILabel{
    /// 创建 UILable
    ///
    /// - parameter text:      text
    /// - parameter textColor: textColor，默认 darkGrayColor
    /// - parameter fontsize:  fontsize ，默认 14
    /// - parameter alignment: alignment 默认左对齐
    ///
    /// - returns: UILable
    convenience init(text: String,
        textColor: UIColor = UIColor.darkGrayColor(),
        fontsize: CGFloat = 14,
        alignment: NSTextAlignment = .Left){
            
            self.init()//先初始化本类对象 在创建属性
            
            self.text = text
            self.textColor = textColor
            self.font = UIFont.systemFontOfSize(fontsize)
            self.textAlignment = alignment
            
            self.numberOfLines = 0
            
            //自动调整字体
            sizeToFit()
            
            
            
    }
 
    
    
    
}
